
package com.lungle.warmdiary.app.view.testcampaign;

import com.lungle.warmdiary.R;
import com.lungle.warmdiary.app.model.response.CampaignList;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignALL;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignEnd;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignToCheck;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignToExecute;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignToRecomend;
import com.lungle.warmdiary.app.view.testcampaign.fragment.status.CampaignToShare;


public enum CampaignListTab {
    CAMPAIGNALL(0, 0, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_0, 0xFF000000, CampaignALL.class),
    CAMPAIGNEXECUTE(1, 1, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_1, 0xFFFBB64D, CampaignToExecute.class),
    CAMPAIGNRECOMEND(2, 2, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_2, 0xFFF94848, CampaignToRecomend.class),
    CAMPAIGNSHARE(3, 4, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_4, 0xFF2DB906, CampaignToShare.class),
    CAMPAIGNCHECK(4, 3, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_3, 0xFFF57818, CampaignToCheck.class),
    CAMPAIGNEND(5, 5, CampaignList.CATALOG_CAMPAIGN, R.string.campaign_status_5, 0xFFB5ABAA, CampaignEnd.class);


    private Class<?> clz;
    private int idx;
    private int title;
    private int catalog;
    public int color;


    private int status;

    private CampaignListTab(int idx, int status, int catalog, int title, int color, Class<?> clz) {
        this.idx = idx;
        this.status = status;
        this.clz = clz;
        this.color = color;
        this.setCatalog(catalog);
        this.setTitle(title);
    }

    public static CampaignListTab getTabByIdx(int idx) {
        for (CampaignListTab t : values()) {
            if (t.getIdx() == idx)
                return t;
        }
        return CAMPAIGNALL;
    }

    public static CampaignListTab getTabByStatus(int status) {
        for (CampaignListTab t : values()) {
            if (t.getStatus() == status)
                return t;
        }
        return CAMPAIGNALL;
    }


    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public int getCatalog() {
        return catalog;
    }

    public void setCatalog(int catalog) {
        this.catalog = catalog;
    }

    public int getStatus() {
        return status;
    }

}
